package com.linkage.jz.bankruptcy.activity.Project.ZQUser.DetailOper;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;

import com.google.gson.Gson;
import com.linkage.jz.bankruptcy.R;
import com.linkage.jz.bankruptcy.adapter.FullyGridLayoutManager;
import com.linkage.jz.bankruptcy.base.BaseCreateActivity;
import com.linkage.jz.bankruptcy.bean.TaskAtta;
import com.linkage.jz.bankruptcy.bean.ZQShowCrDecInfo;
import com.linkage.jz.bankruptcy.widget.PublicNoticeDialog;
import com.linkage.seapeak.pojo.UploadImage;

import org.json.JSONException;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;


/**
 * 变更债权人名称
 */
public class ShowZQReviewActivity extends BaseCreateActivity implements OnClickListener {
    private static final String TAG = ShowZQReviewActivity.class.getSimpleName();


    @Override
    public void setListener() {

    }

    @Override
    public void initTitle() {
    }

    @Override
    public void initView() {

    }

//    private TextView ;
//    private TextView ;
//    private LinearLayout fragment_zq_zq_info_tax_base_item,fragment_zq_zq_info_notax_qr_base_item;
    private TextView tax_msg3,tax_msg4,tax_msg5,tax_msg2,tax_msg6,tax_msg7;
    private TextView notax_qr_msg1,notax_qr_msg2,notax_qr_msg3,notax_qr_msg4,notax_qr_msg5,notax_qr_msg6;

    private TextView tv_zqfristdesc,tv_zqdesc;
    private RecyclerView  mImgRecyclerView2,mImgRecyclerView3,mImgRecyclerView4;

    private List<UploadImage> mImgList1 = new ArrayList<>();
    private GridImagesAdapter mImgAdapter1;

    private List<UploadImage> mImgList2 = new ArrayList<>();
    private GridImagesAdapter mImgAdapter2;

    private List<UploadImage> mImgList3 = new ArrayList<>();
    private GridImagesAdapter mImgAdapter3;


    private List<UploadImage> mImgList4 = new ArrayList<>();
    private GridImagesAdapter mImgAdapter4;

    private static ZQShowCrDecInfo mInfo;


    public static void start(Context context, ZQShowCrDecInfo info) {
        Intent intent = new Intent(context, ShowZQReviewActivity.class);
        mInfo = info;
        context.startActivity(intent);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        setContentView(R.layout.activity_show_zq_review_apply);
        super.onCreate(savedInstanceState);
        titlebar_title = findViewById(R.id.top_title);
            titlebar_title.setText("审查信息");


        initViews();
        initData();


    }


    private void initViews() {
        titlebar_back = findViewById(R.id.top_back1);

        titlebar_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });

        if(mInfo.getCreditorInfo()!=null)
        {

                ((TextView)findViewById(R.id.tv_review1)).setText(  mInfo.getCrDecRev().getReviewResults());
                ((TextView)findViewById(R.id.tv_review2)).setText( mInfo.getCrDecRev().getSupplementaryMaterial());
                ((TextView)findViewById(R.id.tv_review3)).setText(mInfo.getCrDecRev().getSpecialNote());


           if(mInfo.getCreditorInfo().getIdentityBigTypes()!=null && mInfo.getCreditorInfo().getIdentityBigTypes().getValue()!=2)
            {



                    findViewById(R.id.time_base_2).setVisibility(View.VISIBLE);
                    float f = 0.00f;
                    if ("".equalsIgnoreCase(mInfo.getCrDecRev().getConfirmedMoney())) {
                        f = 0.00f;
                    } else {
                        f = Float.parseFloat(mInfo.getCrDecRev().getConfirmedMoney());
                    }
                ((TextView)findViewById(R.id.notax_msg1)).setText(f + "元");


                    if ("".equalsIgnoreCase(mInfo.getCrDecRev().getOrdinaryMoney())) {
                        f = 0.00f;
                    } else {
                        f = Float.parseFloat(mInfo.getCrDecRev().getOrdinaryMoney());
                    }
                ((TextView)findViewById(R.id.notax_msg2)).setText(f + "元");

                    if ("".equalsIgnoreCase(mInfo.getCrDecRev().getGuaranteePriority())) {
                        f = 0.00f;
                    } else {
                        f = Float.parseFloat(mInfo.getCrDecRev().getGuaranteePriority());
                    }
                ((TextView)findViewById(R.id.notax_msg3)).setText(f + "元");

                    if ("".equalsIgnoreCase(mInfo.getCrDecRev().getOtherPriorityMoney())) {
                        f = 0.00f;
                    } else {
                        f = Float.parseFloat(mInfo.getCrDecRev().getOtherPriorityMoney());
                    }
                ((TextView)findViewById(R.id.notax_msg4)).setText(f + "元");

                    if ("".equalsIgnoreCase(mInfo.getCrDecRev().getUndeterminedMoney())) {
                        f = 0.00f;
                    } else {
                        f = Float.parseFloat(mInfo.getCrDecRev().getUndeterminedMoney());
                    }
                ((TextView)findViewById(R.id.notax_msg5)).setText(f + "元");

                    if ("".equalsIgnoreCase(mInfo.getCrDecRev().getDisconfirmationMoney())) {
                        f = 0.00f;
                    } else {
                        f = Float.parseFloat(mInfo.getCrDecRev().getDisconfirmationMoney());
                    }
                ((TextView)findViewById(R.id.notax_msg6)).setText(f + "元");
//                }
            }else{

                   findViewById(R.id.time_base_1).setVisibility(View.VISIBLE);

                   float f = 0.00f;
                   if ("".equalsIgnoreCase(mInfo.getCrDecRev().getConfirmedMoney())) {
                       f = 0.00f;
                   } else {
                       f = Float.parseFloat(mInfo.getCrDecRev().getConfirmedMoney());
                   }
                   ((TextView)findViewById(R.id.tax_msg1)).setText(f + "元");

                   if ("".equalsIgnoreCase(mInfo.getCrDecRev().getRegularTaxMoney())) {
                       f = 0.00f;
                   } else {
                       f = Float.parseFloat(mInfo.getCrDecRev().getRegularTaxMoney());
                   }
                   ((TextView)findViewById(R.id.tax_msg2)).setText(f + "元");

                   if ("".equalsIgnoreCase(mInfo.getCrDecRev().getOverdueFineMoney())) {
                       f = 0.00f;
                   } else {
                       f = Float.parseFloat(mInfo.getCrDecRev().getOverdueFineMoney());
                   }
                   ((TextView)findViewById(R.id.tax_msg3)).setText(f + "元");

                   if ("".equalsIgnoreCase(mInfo.getCrDecRev().getOtherMoney())) {
                       f = 0.00f;
                   } else {
                       f = Float.parseFloat(mInfo.getCrDecRev().getOtherMoney());
                   }
                   ((TextView)findViewById(R.id.tax_msg4)).setText(f + "元");

                   if ("".equalsIgnoreCase(mInfo.getCrDecRev().getUndeterminedMoney())) {
                       f = 0.00f;
                   } else {
                       f = Float.parseFloat(mInfo.getCrDecRev().getUndeterminedMoney());
                   }
                   ((TextView)findViewById(R.id.tax_msg5)).setText(f + "元");

                   if ("".equalsIgnoreCase(mInfo.getCrDecRev().getDisconfirmationMoney())) {
                       f = 0.00f;
                   } else {
                       f = Float.parseFloat(mInfo.getCrDecRev().getDisconfirmationMoney());
                   }
                   ((TextView)findViewById(R.id.tax_msg6)).setText(f + "元");




           }
        }






    }

    @Override
    public void initData() {


    }

    private boolean showflag = true;

    @Override
    public void onBackPressed() {
        finish();

    }


    private PublicNoticeDialog noticeDialog;

    @Override
    public void onClick(View view) {
        Intent intent;
        switch (view.getId()) {

            case R.id.titlebar_menu_text:
//                saveData();
                break;
            case R.id.top_back1:
                finish();
                break;
            default:
                break;
        }
    }





}

